﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrganSetup.aspx.cs" Inherits="SysManage_OrganSetup" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>组织机构设置</title>
    <script src="../Scripts/jquery-1.8.3.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
    <script src="../Scripts/OrganSetup.js" type="text/javascript"></script>
    <link rel="stylesheet" href="../Content/redmond/jquery-ui-1.9.2.custom.min.css"
        type="text/css" />
    <link rel="stylesheet" href="../Content/SysManage.css" type="text/css" /> 
</head>
<body>
    <form id="form1" runat="server">
    <div class="ContentDiv">
        <asp:GridView ID="OrganList" runat="server" AutoGenerateColumns="False" EmptyDataText="对不起,未找到相关数据！"
                Width="100%" CssClass="ui-widget ui-widget-content" OnRowCommand="OrganList_RowCommand" 
                OnRowCancelingEdit="OrganList_RowCancelingEdit" OnRowEditing="OrganList_RowEditing" 
                OnRowUpdating="OrganList_RowUpdating" DataKeyNames="organ" OnRowDataBound="OrganList_RowDataBound">
                <HeaderStyle CssClass="ui-widget-header" />
                <Columns>
                    <asp:BoundField DataField="organ" HeaderText="组织机构名称" SortExpression="organ"
                        ReadOnly="True"></asp:BoundField>
                    <asp:TemplateField HeaderText="主负责人" SortExpression="manager">
                        <EditItemTemplate>
                            <asp:DropDownList ID="Manager_D" runat="server"></asp:DropDownList> 
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Manage_L" runat="server" Text='<%# Bind("manager") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="organ_type" HeaderText="机构类型" SortExpression="organ_type"
                        ReadOnly="True"></asp:BoundField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemStyle HorizontalAlign="Right"/>
                        <EditItemTemplate>
                                <asp:Button ID="Modify" runat="server" CausesValidation="false"
                                Text="保存更改" CommandName="Update" CssClass="ui-button ui-state-default ui-corner-all"/>
                                <asp:Button ID="Cancel" runat="server" CausesValidation="false"
                                Text="取消" CommandName="Cancel" CssClass="ui-button ui-state-default ui-corner-all"/>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="Edit" runat="server" CausesValidation="false"
                                Text="设置主负责人" CommandName="Edit" CssClass="ui-button ui-state-default ui-corner-all"/>
                            <asp:Button ID="ChargeStatus" runat="server" CausesValidation="false"
                                Text="禁用" CommandName="Charge" CommandArgument='<%# Bind("organ")%>' 
                                OnClientClick="return confirm('确认需要禁用该机构吗？');" CssClass="ui-button ui-state-default ui-corner-all"/>
                            <asp:Button ID="DeleteOrgan" runat="server" CausesValidation="false"
                                Text="删除" CommandName="DeleteOrgan" CommandArgument='<%# Bind("organ")%>' 
                                OnClientClick="return confirm('确认要删除该机构吗？');" CssClass="ui-button ui-state-default ui-corner-all"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div style="text-align: right; padding: 5px;">
                <input id="AddOrgan" type="button" value="新增机构" class="BtnLeft" />
            </div>            
    </div>
   <div id="AddOrganDiv" title="新增组织机构" class="DialogDiv">
            <div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;" id="MsgDiv"> 
	            <p style="padding:4px 2px;"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> 
	            <strong>提示:</strong><label id="JQmsg" runat="server" style="color:Red;"></label></p>
            </div>
            <fieldset>
                <p>
                    <label for="Organ_A">
                        名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称:</label>
                    <asp:TextBox ID="Organ_A" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="20"></asp:TextBox></p>
                <p>
                    <label for="Upper_A">
                        上级机构:</label>
                    <asp:DropDownList runat="server" ID="Upper_A" CssClass="text ui-widget-content ui-corner-all">
                    </asp:DropDownList></p>
                <p>
                    <label for="Organ_Type_A">
                        机构类型:</label>
                    <asp:DropDownList runat="server" ID="Organ_Type_A" CssClass="text ui-widget-content ui-corner-all">
                    </asp:DropDownList></p>
            </fieldset>
            <p class="ActionP">
                <asp:Button ID="BtnCreate" runat="server" Text="创建" OnClick="BtnCreate_Click" />
                <input id="BtnCancel" type="button" value="取消" /></p>
        </div> 
    </form>
</body>
</html>
